﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SkypeBot.Core
{
    public class MessageHandler
    {
        private Commands.Commands _commandResult;
        private Commands.Commands CommandResult
        {
            get
            {
                if (_commandResult == null)
                    _commandResult = new Commands.Commands();
                return _commandResult;
            }
        }

        private Dictionaries.Dictionaries _dictionaryResult;
        private Dictionaries.Dictionaries DictionaryResult
        {
            get
            {
                if (_dictionaryResult == null)
                    _dictionaryResult = new Dictionaries.Dictionaries();
                return _dictionaryResult;
            }
        }

        public Responce Handle(Message objMessage)
        {
            IResult Result;
            if (objMessage.MessageContent.StartsWith("!"))
            {
                Result = CommandResult;
            }
            else
            {
                Result = DictionaryResult; 
            }
  // To Do -- Add logic for rest options
            return Result.GetResult(objMessage);
        }
    }
}
